package cn.com.blueInfo.bpm.system.convert;

import cn.com.blueInfo.bpm.common.convert.BaseConvert;
import cn.com.blueInfo.bpm.system.entity.UserRole;
import cn.com.blueInfo.bpm.system.request.UserRoleDTO;
import cn.com.blueInfo.bpm.system.response.UserRoleVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

/**
 * 用户-角色关联表 对象转换
 * @author suxch
 * @since 2025-08-31 16:20:56
 */
@Mapper(componentModel = "spring")
public interface UserRoleConvert
        extends BaseConvert<UserRole, UserRoleDTO, UserRoleVO> {

    UserRole dtoToEntity(UserRoleDTO dto);

    UserRole dtoToEntity(UserRoleDTO.UpdatePartialDTO dto);

    @Mapping(source = "status", target = "status", qualifiedByName = "enumToDesc")
    @Mapping(source = "deleted", target = "deleted", qualifiedByName = "enumToDesc")
    UserRoleVO entityToVO(UserRole entity);

}